import { Notify,Dialog, Toast } from 'vant'


const newUtils = {
  isPhoneNumber:function(value){
    const testPhone =
    /^((\+?86)|(\(\+86\)))?(1[3456789]\d{9})$/;
    const testFixedPhone = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
    if (!value || value.length <= 0) {
      Notify('请填写联系方式');
      return false;
    }
    if (!testPhone.test(value) && !testFixedPhone.test(value)) {
      Notify('请填写正确的联系方式');
      return false;
    }
    return true;
  }

}

export default newUtils